export const state = () => ({
  token: ''
})

export const getters = {
  
}

export const mutations = {
  setToken(state, token) {
    state.token = token
    this.$cookies.set('token', token)
  },
  getToken(state) {
    state.token = this.$cookies.get('token')
  }
}

// export const actions = {
//   nuxtServerInit(store, context) { // 服务端运行，不区分页面，进入哪个页面都会执行
//     store.commit('setToken', '1234567890')
//     console.log('nuxtServerInit', store)
//   } 
// }
